package adrian.sunlight.ws.axis2;

import java.util.Vector;

public class ResourceUpdatingService {

	private Vector<String> Resources 		 = new Vector<String>();
	private Vector<String> LatestUpdateTimes = new Vector<String>();
	
	public void notifyUpdate(String resource){
		
		Integer index = this.Resources.indexOf(resource);
		String time   = TheTime.now();
		
		if((index != null) && (index > -1)){
			this.LatestUpdateTimes.remove(index);
			this.LatestUpdateTimes.add(index, time);
		}
		else{
			this.Resources.add(resource);
			this.LatestUpdateTimes.add(time);
		}
	}
	
	public String getLastUpdate(String resource){
		
		Integer index = this.Resources.indexOf(resource);
		
		if(index > -1){
			return this.LatestUpdateTimes.get(index);
		}
		
		return "";
	}
	
}
